package com.ruoyi.develop.lnShebeiWeibao.service.impl;

import java.util.List;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.DateUtils;
        import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.ruoyi.develop.lnShebeiWeibao.mapper.LnShebeiWeibaoMapper;
import com.ruoyi.develop.lnShebeiWeibao.domain.LnShebeiWeibao;
import com.ruoyi.develop.lnShebeiWeibao.service.ILnShebeiWeibaoService;

/**
 * 设备维修保养Service业务层处理
 * @author lmm
 * @date 2025-07-30
 */
@Service
public class LnShebeiWeibaoServiceImpl implements ILnShebeiWeibaoService {
    @Resource
    private LnShebeiWeibaoMapper lnShebeiWeibaoMapper;

    /**
     * 查询设备维修保养
     * @param id 设备维修保养主键
     * @return 设备维修保养
     */
    @Override
    public LnShebeiWeibao selectById(String id) {
        return lnShebeiWeibaoMapper.selectById(id);
    }

    /**
     * 查询设备维修保养列表
     * @param entity 设备维修保养
     * @return 设备维修保养
     */
    @Override
    public List<LnShebeiWeibao> selectList(LnShebeiWeibao entity) {
        return lnShebeiWeibaoMapper.selectList(entity);
    }

    /**
     * 新增设备维修保养
     * @param entity 设备维修保养
     * @return 结果
     */
    @Override
    public int insert(LnShebeiWeibao entity) {
        if(StringUtils.isBlank(entity.getId())){
            entity.setId(IdUtils.fastSimpleUUID());
        }
                entity.setCreateBy(SecurityUtils.getUsername());
                entity.setCreateTime(DateUtils.getNowDate());
            return lnShebeiWeibaoMapper.insert(entity);
    }

    /**
     * 修改设备维修保养
     * @param entity 设备维修保养
     * @return 结果
     */
    @Override
    public int update(LnShebeiWeibao entity) {
                entity.setUpdateBy(SecurityUtils.getUsername());
                entity.setUpdateTime(DateUtils.getNowDate());
        return lnShebeiWeibaoMapper.update(entity);
    }

    /**
     * 批量删除设备维修保养
     * @param ids 需要删除的设备维修保养主键
     * @return 结果
     */
    @Override
    public int deleteByIds(String[] ids) {
        return lnShebeiWeibaoMapper.deleteByIds(ids);
    }

    /**
     * 删除设备维修保养信息
     * @param id 设备维修保养主键
     * @return 结果
     */
    @Override
    public int deleteById(String id) {
        return lnShebeiWeibaoMapper.deleteById(id);
    }
}
